package com.pai4j.common.util;

import java.util.Random;

public class NameUtil {
    
    private static final String[] ARTYAN_CHARACTERS = {
            "梦", "幻", "墨", "韵", "灵", "瑶", "云", "影", "风", "雪", "月", "夜", "星", "天", "佑", "明", "海", "", "浪", "火", "春", "夏", "秋", "冬", "北", "南"
    };
    
    private static final Random RANDOM = new Random();
    
    public static String generateRandomName(int length) {
        StringBuilder name = new StringBuilder();
        if (length < 2 || length > 4) {
            throw new IllegalArgumentException("Name length should be between 2 and 4 characters.");
        }
        
        for (int i = 0; i < length; i++) {
            name.append(ARTYAN_CHARACTERS[RANDOM.nextInt(ARTYAN_CHARACTERS.length)]);
        }
        
        return name.toString();
    }
    
    public static String generateRandomName() {
        int length = RANDOM.nextInt(2, 5); // 生成3到5个字的名字
        return generateRandomName(length);
    }
    
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            System.out.println(generateRandomName());
        }
    }
}
